import {ResDto} from "../types/common";
import instance from "../axios.service";
import {BaseUrl} from "../common/constants";

export default {
    getList: (): Promise<ResDto> => instance.get(`${BaseUrl}/v1/department/info`),
    create: (data: any): Promise<ResDto> => instance.post(`${BaseUrl}/v1/department/add`, data),
    edit: (data: any): Promise<ResDto> => instance.put(`${BaseUrl}/v1/department/deal`, data),
    del: (code: string): Promise<ResDto> => instance.delete(`${BaseUrl}/v1/department/delete/${code}`),
}
